package com.view.jameson.androidrecyclerviewcard.hv2;

import android.view.View;

/**
 * Created by chensuilun on 2016/12/16.
 */
public class ScaleTransformer implements GalleryLayoutManager2.ItemTransformer {

    private static final String TAG = "CurveTransformer";


    @Override
    public void transformItem(GalleryLayoutManager2 layoutManager, View item, float fraction) {
        item.setPivotX(item.getWidth() / 2.0f);
        item.setPivotY(item.getHeight()/2.0f);
        float scaleX = 1 - 0.1f * Math.abs(fraction);
        float scaleY = 1 - 0.2f * Math.abs(fraction);
//        item.setScaleX(0.98f);
//        item.setScaleX(0.95f);
        item.setScaleY(scaleY);

    }

}
